package com.ctsi.commons.util.response;

import java.util.List;

/**
 * @author: 前台数据封装
 * @Date: 2018/11/7 03:35
 * @Description:
 */
public class PageUtil<T> {
    private long totalCount;
    private List<T> list;

    public PageUtil() {
    }

    public PageUtil(Page<T> page) {
        this.totalCount = page.getTotalCount();
        this.list = page.getResult();
    }
    public PageUtil(PaginationSupport<T> page) {
        this.totalCount = page.getTotalCount();
        this.list =  page.getItems();
    }

    public PageUtil(List<T> list, long totalCount) {
        this.totalCount = totalCount;
        this.list = list;
    }
    public PageUtil(List<T> list, int totalCount) {
        this.totalCount = totalCount;
        this.list = list;
    }
    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

}
